<?php

require ("sharedResources.php");

define("ROOT_FOLDER", 5);

$sid = '';
try {
    // We need a SID (session ID) in order to operate
	$sid = login ( 'admin', 'admin' );
	echo 'sid: ' . $sid . PHP_EOL;
    
  $cfp = array ('sid' => $sid, 'folderId' => ROOT_FOLDER );
  //print_r ( $wsParams );
    
	// Get folder children (To be sure if a folder is a workspace you should check for type = 1)
	$result = $folderClient->listChildren ( $cfp );
  print_r ( $result );    
    
	//unset ( $folderClient );
} catch ( SoapFault $e ) {
	print_r ( $e );
}

// Always we need to logout in order to release connection slot
logout ( $sid );
?> 